//
//  BkInputItemView.m
//  TuDianEducation
//
//  Created by lixinkeji on 2021/1/11.
//  Copyright © 2021 zhangbenchao. All rights reserved.
//

#import "BkInputItemView.h"
@interface BkInputItemView()
@property (nonatomic,strong) UILabel *titleLabel;

@end

@implementation BkInputItemView
-(instancetype)initWithTop:(CGFloat) top Title:(NSString *)title placeHolder:(NSString *)placeHoder{
    if (self = [super init])
    {
        self.frame = CGRectMake(0, top, TSScreenWidth, TSScaleW(64));
        [self addSubview:self.titleLabel];
        [self addSubview:self.inputTextField];
        self.titleLabel.text = title;
        self.inputTextField.placeholder = placeHoder;
    }
    return self;
};

-(UILabel *)titleLabel
{
    if (!_titleLabel) {
        _titleLabel = [TSWLTools allocLabel:@"昵称" font:systemFont(TSScaleW(14)) textColor:kMainTxtColor frame:CGRectMake(TSScaleW(25), TSScaleW(0), TSScaleW(200), TSScaleW(14)) textAlignment:(NSTextAlignmentLeft)];
    }
    return _titleLabel;
}

-(UITextField *)inputTextField
{
    if (!_inputTextField) {
        _inputTextField = [TSWLTools allocTextFieldText:systemFont(TSScaleW(12)) placeHolderFont:systemFont(TSScaleW(12)) text:nil placeText:@"请输入昵称" textColor:kMainTxtColor placeHolderTextColor:kSubTxtColor frame:CGRectMake(_titleLabel.left, TSScaleW(16) + _titleLabel.bottom, TSScaleW(325), TSScaleW(33))];
        _inputTextField.backgroundColor = kSubBacColor;
        _inputTextField.layer.cornerRadius = TSScaleW(3);
        UIView *v = [[UIView alloc]initWithFrame:CGRectMake(0, 0, TSScaleW(13), _inputTextField.height)];
        _inputTextField.leftViewMode = UITextFieldViewModeAlways;
        _inputTextField.leftView = v;
    }
    return _inputTextField;
}


@end
